package com.ruoyi.training.dto;

import com.ruoyi.training.domain.Records;

import java.util.List;

public class RecordsUploadProcessDto extends Records {
    // 1. 统计数据（整体处理结果）
    private int totalRegistrationCount;      // 总处理的报名数
    private int successRegistrationCount;    // 成功处理的报名数
    private int failRegistrationCount;       // 失败处理的报名数
    private int totalFileCount;              // 总处理的文件数
    private int successFileCount;            // 成功上传的文件数
    private int failFileCount;               // 上传失败的文件数
    private String errorMessage;             // 全局错误信息

    // 新增：补充上传的统计字段
    private int addFileCount;        // 新增文件总数
    private int replaceFileCount;    // 替换文件总数

    // 2. 每个报名的处理详情（列表）
    private List<RegistrationProcessDetail> processDetails;

    // 内部类：单个报名的处理详情
    public static class RegistrationProcessDetail {
        private String registrationId;       // 报名ID
        private String name;                 // 报名人姓名
        private String idCard;               // 报名人身份证号
        private boolean success;             // 该报名整体处理是否成功
        private int fileCount;               // 该报名对应的文件夹中文件总数
        private String message;              // 该报名的整体处理信息
        private List<FileDetail> fileDetails;// 该报名下所有文件的详细处理结果

        // getter和setter方法
        public String getRegistrationId() {
            return registrationId;
        }

        public void setRegistrationId(String registrationId) {
            this.registrationId = registrationId;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getIdCard() {
            return idCard;
        }

        public void setIdCard(String idCard) {
            this.idCard = idCard;
        }

        public boolean isSuccess() {
            return success;
        }

        public void setSuccess(boolean success) {
            this.success = success;
        }

        public int getFileCount() {
            return fileCount;
        }

        public void setFileCount(int fileCount) {
            this.fileCount = fileCount;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }

        public List<FileDetail> getFileDetails() {
            return fileDetails;
        }

        public void setFileDetails(List<FileDetail> fileDetails) {
            this.fileDetails = fileDetails;
        }
    }

    // 内部类：单个文件的处理详情（新增fileUrl字段）
    public static class FileDetail {
        private String fileName;             // 文件名
        private String filePath;             // 服务器本地路径（后端内部使用）
        private String fileUrl;              // 前端可访问的图片URL（新增）
        private String fileType;             // 图片类型（通过内容识别）
        private boolean fileSuccess;         // 该文件是否处理成功
        private String fileMessage;          // 该文件的处理信息
        // 新增：操作类型（"新增"或"替换"）
        private String operationType;

        // getter和setter方法
        public String getFileName() {
            return fileName;
        }

        public void setFileName(String fileName) {
            this.fileName = fileName;
        }

        public String getFilePath() {
            return filePath;
        }

        public void setFilePath(String filePath) {
            this.filePath = filePath;
        }

        public String getFileUrl() {
            return fileUrl;
        }

        public void setFileUrl(String fileUrl) {
            this.fileUrl = fileUrl;
        }

        public String getFileType() {
            return fileType;
        }

        public void setFileType(String fileType) {
            this.fileType = fileType;
        }

        public boolean isFileSuccess() {
            return fileSuccess;
        }

        public void setFileSuccess(boolean fileSuccess) {
            this.fileSuccess = fileSuccess;
        }

        public String getFileMessage() {
            return fileMessage;
        }

        public void setFileMessage(String fileMessage) {
            this.fileMessage = fileMessage;
        }

        public String getOperationType() {
            return operationType;
        }

        public void setOperationType(String operationType) {
            this.operationType = operationType;
        }
    }

    // 外层类的getter和setter方法
    public int getTotalRegistrationCount() {
        return totalRegistrationCount;
    }

    public void setTotalRegistrationCount(int totalRegistrationCount) {
        this.totalRegistrationCount = totalRegistrationCount;
    }

    public int getSuccessRegistrationCount() {
        return successRegistrationCount;
    }

    public void setSuccessRegistrationCount(int successRegistrationCount) {
        this.successRegistrationCount = successRegistrationCount;
    }

    public int getFailRegistrationCount() {
        return failRegistrationCount;
    }

    public void setFailRegistrationCount(int failRegistrationCount) {
        this.failRegistrationCount = failRegistrationCount;
    }

    public int getTotalFileCount() {
        return totalFileCount;
    }

    public void setTotalFileCount(int totalFileCount) {
        this.totalFileCount = totalFileCount;
    }

    public int getSuccessFileCount() {
        return successFileCount;
    }

    public void setSuccessFileCount(int successFileCount) {
        this.successFileCount = successFileCount;
    }

    public int getFailFileCount() {
        return failFileCount;
    }

    public void setFailFileCount(int failFileCount) {
        this.failFileCount = failFileCount;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) {
        this.errorMessage = errorMessage;
    }

    public List<RegistrationProcessDetail> getProcessDetails() {
        return processDetails;
    }

    public void setProcessDetails(List<RegistrationProcessDetail> processDetails) {
        this.processDetails = processDetails;
    }

    public int getAddFileCount() {
        return addFileCount;
    }

    public void setAddFileCount(int addFileCount) {
        this.addFileCount = addFileCount;
    }

    public int getReplaceFileCount() {
        return replaceFileCount;
    }

    public void setReplaceFileCount(int replaceFileCount) {
        this.replaceFileCount = replaceFileCount;
    }
}
